const paths=require("./paths");
const babel=require("rollup-plugin-babel");
import typescript from 'rollup-plugin-typescript2';
import commonjs from 'rollup-plugin-commonjs';
const extensions = ['.ts',".tsx",".js",".jsx"];
module.exports=[{
    input:[paths.app],
    output:[{
        dir: './lib/es',
        format: 'es',
        banner: '// welcome to imooc.com',
        footer: '// powered by sam',
        entryFileNames:"[name].js"
    },{
        dir: './lib/js',
        format: 'cjs',
        banner: '// welcome to imooc.com',
        footer: '// powered by sam',
        entryFileNames:"[name].js",
    }],
    plugins: [
        typescript(),
        commonjs(),
        babel({
            exclude: 'node_modules/**', // 只编译源代码
            runtimeHelpers: true,
            extensions
        }),
    ],
},{
    input:paths.app,
    output:[{
        file:"./lib/dist/test.min.js",
        format: 'umd',
        banner: '// welcome to imooc.com',
        footer: '// powered by sam',
        name:"test"
    }],
    plugins: [
        typescript(),
        commonjs(),
        babel({
            exclude: 'node_modules/**', // 只编译源代码
            runtimeHelpers: true,
            extensions
        }),
    ],
}]